using System;
namespace ch.ethz.ssh2.packets
{
	
	/// <summary> PacketUserauthRequestInteractive.
	/// 
	/// </summary>
	/// <author>  Christian Plattner
	/// </author>
	/// <version>  2.50, 03/15/10
	/// </version>
	public class PacketUserauthRequestInteractive
	{
		virtual public byte[] Payload
		{
			get
			{
				if (payload == null)
				{
					TypesWriter tw = new TypesWriter();
					tw.writeByte(Packets.SSH_MSG_USERAUTH_REQUEST);
					tw.writeString(userName);
					tw.writeString(serviceName);
					tw.writeString("keyboard-interactive");
					tw.writeString(""); // draft-ietf-secsh-newmodes-04.txt says that
					// the language tag should be empty.
					tw.writeNameList(submethods);
					
					payload = tw.getBytes();
				}
				return payload;
			}
			
		}
		internal byte[] payload;
		
		internal System.String userName;
		internal System.String serviceName;
		internal System.String[] submethods;
		
		public PacketUserauthRequestInteractive(System.String serviceName, System.String user, System.String[] submethods)
		{
			this.serviceName = serviceName;
			this.userName = user;
			this.submethods = submethods;
		}
	}
}